﻿using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Mammoth.Entities;
using Mammoth.Mocks;
using Mammoth.Repositories;
using Mammoth.Services;

namespace Mammoth.Installers
{
    public class MockExpensiveServiceInstaller : IWindsorInstaller
    {
        public void Install(Castle.Windsor.IWindsorContainer container, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore store)
        {
            container.Register(Component.For<IDataSessionFactory>()
                .ImplementedBy<DataSessionFactoryMock>());
            container.Register(Component.For(typeof(IRepository<>))
                .ImplementedBy(typeof(RepositoryMock<>))
                .LifeStyle.Transient);
        }
    }
}
